project(FACTORIZE C CXX)

set(CMAKE_CXX_COMPILER mpicxx)
set(CMAKE_C_COMPILER mpicc)

add_library(DNMF
  anls_sparse.cc
  anls_sequential.cc
  anls_concensus.cc
  anls_decentralized.cc
  anls_decentralized_less.cc
  lf_decentralized.cc
  mpi_helper.h
  graph_helper.h
  arma_helper.h
  arma_helper.cc 
  bcd_sequential.cc
  bpp_sequential.cc
  bpp_map_reduce.cc
  bpp_map_reduce_manyrhs.cc
)

target_link_libraries(DNMF
  ${ALL_LIBS}
)

add_executable(lmf
  lmf_main.cpp 
  mpi_helper.h
  )

target_link_libraries (lmf
  ${ALL_LIBS}
  ) 

add_executable(nmf
  nmf_main.cpp 
  mpi_helper.h
  )

target_link_libraries (nmf
  ${ALL_LIBS}
  ) 
